Skip to content

Implement ability for run-task to fetch secrets - #1110

Merged
ahal merged 3 commits into
taskcluster:mainfrom
ahal:ahal/krpvwwsmzzts
Nov 16, 2026
Merged

ahal merged 3 commits into
taskcluster:mainfrom
ahal:ahal/krpvwwsmzzts

Conversation

@ahal

@ahal ahal commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@ahal ahal self-assigned this Nov 13, 2026
@ahal
ahal requested a review from a team as a code owner November 13, 2026 15:06
@ahal
ahal requested a review from jcristau November 13, 2026 15:06
@ahal
ahal force-pushed the ahal/krpvwwsmzzts branch 2 times, most recently from 1f70b10 to f84bc03 Compare November 13, 2026 15:16
The environment variable to export the secret in.
``file``
The file to write the secret to. Relative paths are relative to the
task's working directory. Missing parent directories are created, and on

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a potential conflict here?
If the secret is fetched into the same path as the checkout, and happens before checkout, would the checkout fail? Should we add a check for this? (Seems corner case AND self-inflicted, but still)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking for this adds a moderate amount of complexity, I don't think it's worth it tbh.. Just.. don't do that :p

Comment thread docs/reference/run-task.rst Resolved
Comment thread src/taskgraph/run-task/run-task Resolved
Comment thread docs/howto/use-secrets.rst Resolved
@ahal
ahal force-pushed the ahal/krpvwwsmzzts branch 3 times, most recently from 8a03cd4 to 669f3d3 Compare November 16, 2026 17:16
@ahal
ahal requested a review from hneiva November 16, 2026 17:16
ahal added 3 commits November 16, 2026 13:28
A RUN_TASK_SECRETS entry of type 'secret' fetches a secret from Taskcluster's
secrets service. It exports the secret, or one of its keys, to an environment
variable, or writes it to a file only the task's user can read. Unlike
github-repo-token, a failure to fetch the secret fails the task, since a task
that asks for a secret can't do without it.
Tasks using the run transforms can list secrets for run-task to fetch in a
'secrets' key, rather than writing RUN_TASK_SECRETS by hand. The new
use_secrets transform serializes the list into RUN_TASK_SECRETS, adds the
scopes each secret needs, and enables the taskcluster proxy. A
github-repo-token's repo defaults to the base_repository parameter.
The codecov and push-image tasks fetched their secrets themselves. List
them in 'secrets' instead, so run-task fetches them and the transforms add
the scopes. The codecov uploader now reads its token from CODECOV_TOKEN.
push-image gets its auth file written by run-task, which also fixes a
fetch failure going unnoticed until skopeo tried to use the bad file.
@ahal
ahal force-pushed the ahal/krpvwwsmzzts branch from 669f3d3 to caba8a7 Compare November 16, 2026 18:29
@ahal
ahal enabled auto-merge (rebase) November 16, 2026 18:29
@ahal
ahal merged commit 26ff85a into taskcluster:main Nov 16, 2026
22 checks passed
@ahal
ahal deleted the ahal/krpvwwsmzzts branch November 16, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants